package com.cjk.foundation.dao;


import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.cjk.foundation.entity.ChannelDetailEntity;

@Repository
public interface ChannelDetailDao {

	public List<ChannelDetailEntity> selectListByCondition(@Param("groupId") Integer groupId, @Param("page") Integer page, @Param("pageSize") Integer pageSize);
	
	public Integer selectCountByCondition(@Param("groupId") Integer groupId);
	
	@ResultMap("resultMap")
	@Select("select * from channel_detail where id = #{id}")
	public ChannelDetailEntity selectById(@Param("id") Integer id);
	
	public void insert(ChannelDetailEntity channelEntity);
	
	public void update(ChannelDetailEntity channelEntity);
	
	public ChannelDetailEntity selectByName(@Param("groupId") Integer groupId, @Param("name") String name, @Param("id") Integer id);
	
	@Delete("delete from channel_detail where id = #{id}")
	public void delete(@Param("id") Integer id);
	
	public void deleteByIds(@Param("groupId") Integer groupId, @Param("ids") List<Integer> ids);
	
	@Delete("delete from channel_detail where group_id = #{groupId}")
	public void deleteByGroupId(@Param("groupId") Integer groupId);
	
}
